window.TS.router = {}

routeFun = (target)->
	return ->
		TS.toView(target, [])

Router = Backbone.Router.extend
	routes:
		"tasks": routeFun "tasks"

router = new Router();

window.TS.router.start = ->
	Backbone.history.start()

window.TS.router.navigate = (target, notTrigger) ->
	router.navigate target, trigger: !notTrigger, replace: notTrigger

$ ->
	Backbone.history.start({pushState: true});